import request from '../utils/request.js'

export const userReg = ({username,password})=>{ //注册
	return request.post('/users',{username,password})
}

export const userLogin = ({username,password})=>{ //登录
	return request.post('/login',{username,password})
}

export const userUpdate = ({objectId,sessionToken},info)=>{ //更新用户信息,info是新信息对象
	// console.log(request);
	request.config.header['X-LC-Session'] = sessionToken
	return request.put(`/users/${objectId}`,info)
}